package chapter14.interfaces;

/**
 * @author : DuJiabao
 * @Date : 2021/3/4 9:58
 * @Project : thinking_in_java
 * @File : null.java
 * @Desc :
 */
public class AnonymousA {
  public static A makeA() {
    // 匿名内部类
    return new A() {
      @Override
      public void f() {
        System.out.println("public C.f()");
      }

      public void g() {
        System.out.println("public C.g()");
      }

      void u() {
        System.out.println("package C.u()");
      }

      protected void v() {
        System.out.println("protected C.v()");
      }

      private void w() {
        System.out.println("private C.w()");
      }
    };
  }
}
